<script setup>
defineProps({
  name: String,
  desc: String,
  price: String,
  picture: String
})
</script>

<template>
  <div class="nav__item__page">
    <img class="nav__item__page__img" :src="picture" alt="" />
    <div class="nav__item__page__text">
      <div class="name">{{ name }}</div>
      <div class="desc">{{ desc }}</div>
      <span style="font-size: 16px; color: #cf4444">￥</span>
      <span style="font-size: 20px; color: #cf4444">{{ price }}</span>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.nav__item__page {
  height: 97px;
  width: 288px;
  padding: 10px;
  display: flex;
  background-color: #fff;
  border-radius: 1%;
  .nav__item__page__img {
    width: 95px;
    height: 95px;
  }
  .nav__item__page__text {
    height: 95px;
    margin-left: 8px;
    flex: 1;
    .name {
      height: 50%;
      font-size: 16px;
      overflow: hidden;     /* 隐藏溢出的内容 */
      text-overflow: ellipsis; /* 使用省略号替换溢出的文本 */
    }
    .desc {
      height: 20%;
      width: 165px;
      font-size: 14px;
      color: #999999;
      white-space: nowrap;  /* 防止文本换行 */
      overflow: hidden;     /* 隐藏溢出的内容 */
      text-overflow: ellipsis; /* 使用省略号替换溢出的文本 */
    }
  }
  &:hover {
    background-color: #e3f9f4;
  }
}
</style>
